import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('manager', () => {
  // 当前操作的应用id
  const appId = ref('')

  function resetAppId(id: string) {
    appId.value = id
    localStorage.setItem('appId', id)
  }

  function getAppId() {
    var appIdValue = localStorage.getItem('appId')
    if (appIdValue) {
      return appIdValue
    }
    return appId.value
  }

  return { resetAppId, getAppId }
})
